

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="一： 前期准备1.1 基础环境
python3 + selenium + chrome浏览器。如果有不懂的可以查阅selenium-python中文文档
chrome-&amp;gt;设置-&amp;gt;关于chrome-&amp;gt;查看版本（我的版本是 80.0.3987.106（正式版本） （64 位））。  
需要下载跟你的chrome版本一致的ChromeDriver可执行驱动下载完解压放在python根目">
  <meta name="author" content="closer">
  <meta name="keywords" content="">
  
  <title>利用python实现Gitee Pages定时自动部署/自动签到 - closer的自留地</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10.6.0/styles/androidstudio.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"blog.zsaa.top","root":"/","version":"1.8.10","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"always","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":"608f2baddd361128381ad2bf9377bf89","google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"YzLqNtMw1YEwwACli1FUsIUM-gzGzoHsz","app_key":"HLUt5izfTvTcbEbOrA59W92a","server_url":"https://yzlqntmw.lc-cn-n1-shared.com"}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>Hello</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="利用python实现Gitee Pages定时自动部署/自动签到">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2020-02-16 20:01" pubdate>
        2020年2月16日 晚上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.1k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      15
       分钟
    </span>
  

  
  
    
      <!-- LeanCloud 统计文章PV -->
      <span id="leancloud-page-views-container" class="post-meta" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="leancloud-page-views"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">利用python实现Gitee Pages定时自动部署/自动签到</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2020年3月12日 晚上
                
              </p>
            
            <div class="markdown-body">
              <h2 id="一：-前期准备"><a href="#一：-前期准备" class="headerlink" title="一： 前期准备"></a>一： 前期准备</h2><h3 id="1-1-基础环境"><a href="#1-1-基础环境" class="headerlink" title="1.1 基础环境"></a>1.1 基础环境</h3><ol>
<li>python3 + selenium + chrome浏览器。<br>如果有不懂的可以查阅<a target="_blank" rel="noopener" href="https://python-selenium-zh.readthedocs.io/zh_CN/latest/">selenium-python中文文档</a></li>
<li>chrome-&gt;设置-&gt;关于chrome-&gt;查看版本（我的版本是 80.0.3987.106（正式版本） （64 位））。  </li>
<li>需要下载跟你的chrome版本一致的<a target="_blank" rel="noopener" href="http://chromedriver.storage.googleapis.com/index.html">ChromeDriver可执行驱动</a><br>下载完解压放在python根目录(即跟python.exe放在一起)。<br><strong>如果上面的ChromeDriver网址打不开，可以使用<a target="_blank" rel="noopener" href="https://npm.taobao.org/mirrors/chromedriver/">ChromeDriver淘宝镜像</a></strong></li>
<li>最好有一台云主机，没有的话需要自己的电脑设定定时开机，定时任务，定时关机。  <span id="more"></span></li>
</ol>
<h3 id="1-2-安装环境"><a href="#1-2-安装环境" class="headerlink" title="1.2 安装环境"></a>1.2 安装环境</h3><ol>
<li>安装python3,不懂的请查阅我的相关blog文。</li>
<li>打开windows命令行，安装selenium<br><code>pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple</code></li>
</ol>
<h3 id="1-3-获取cookie"><a href="#1-3-获取cookie" class="headerlink" title="1.3 获取cookie"></a>1.3 获取cookie</h3><p>首先登录gitee的Gitee Pages服务界面；</p>
<p>点击网页地址栏左边的小锁标志 -&gt; 选择Cookie；</p>
<p>右边弹出的窗口中展开gitee.com -&gt; 展开Cookie -&gt; 点击名为<code>gitee-session-n</code>的项目 -&gt; 下面的内容后面就是你的cookie；</p>
<p>记得要全部复制进去，替换掉下面源码的my_cookie里面的内容。</p>
<h2 id="二：-代码"><a href="#二：-代码" class="headerlink" title="二： 代码"></a>二： 代码</h2><h3 id="2-1-源码"><a href="#2-1-源码" class="headerlink" title="2.1 源码"></a>2.1 源码</h3><figure class="highlight py"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs py"><span class="hljs-comment">#!/usr/bin/python3</span><br><span class="hljs-comment"># -*- coding: utf-8 -*-</span><br><span class="hljs-keyword">import</span> time<br><span class="hljs-keyword">from</span> selenium <span class="hljs-keyword">import</span> webdriver<br><span class="hljs-keyword">from</span> selenium.webdriver.common.alert <span class="hljs-keyword">import</span> Alert<br><span class="hljs-keyword">from</span> selenium.webdriver.chrome.options <span class="hljs-keyword">import</span> Options<br><br><span class="hljs-comment"># 将你的cookie内容替换掉下面的内容</span><br>my_cookie = &#123;<span class="hljs-string">&#x27;domain&#x27;</span>: <span class="hljs-string">&#x27;.gitee.com&#x27;</span>, <span class="hljs-string">&#x27;httpOnly&#x27;</span>: <span class="hljs-literal">True</span>, <span class="hljs-string">&#x27;name&#x27;</span>: <span class="hljs-string">&#x27;gitee-session-n&#x27;</span>, <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/&#x27;</span>, <span class="hljs-string">&#x27;secure&#x27;</span>: <span class="hljs-literal">False</span>,<br>             <span class="hljs-string">&#x27;value&#x27;</span>: <span class="hljs-string">&#x27;内容&#x27;</span>&#125;<br><br><span class="hljs-comment"># 实例化一个启动参数对象</span><br>options = Options()<br><br><span class="hljs-comment"># 设置启动浏览器时窗口最大化运行</span><br><span class="hljs-comment"># options.add_argument(&#x27;--start-maximized&#x27;)</span><br><br><span class="hljs-comment"># 设置无界面模式运行浏览器</span><br>options.add_argument(<span class="hljs-string">&#x27;-headless&#x27;</span>)<br><br><span class="hljs-comment"># 不加载图片, 提升速度</span><br>prefs = &#123;<span class="hljs-string">&quot;profile.managed_default_content_settings.images&quot;</span>: <span class="hljs-number">2</span>&#125;<br>options.add_experimental_option(<span class="hljs-string">&quot;prefs&quot;</span>, prefs)<br><br><span class="hljs-comment"># 打开浏览器</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&#x27;Launch browser&#x27;</span>)<br>driver = webdriver.Chrome(chrome_options=options)<br><br><span class="hljs-comment"># 删除缓存</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&#x27;Delete cookies&#x27;</span>)<br>driver.delete_all_cookies()<br><br><span class="hljs-comment"># 访问网页</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&#x27;Visit website&#x27;</span>)<br><span class="hljs-comment"># 这里链接改为你的码云部署页面的链接</span><br>driver.get(<span class="hljs-string">&quot;https://gitee.com/此处改为你的ID/此处改为你的ID/pages&quot;</span>)<br>time.sleep(<span class="hljs-number">5</span>)<br><br><span class="hljs-comment"># 加载cookie</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&#x27;Add cookie&#x27;</span>)<br>driver.add_cookie(my_cookie)<br><br><span class="hljs-comment"># 刷新</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&#x27;Refresh&#x27;</span>)<br>driver.refresh()<br>time.sleep(<span class="hljs-number">5</span>)<br><br><span class="hljs-comment"># 点击更新按钮--通过xpath确定点击位置</span><br>driver.find_element_by_xpath(<span class="hljs-string">&#x27;//*[@id=&quot;pages-branch&quot;]/div[7]&#x27;</span>).click()<br>time.sleep(<span class="hljs-number">3</span>)<br><br><span class="hljs-comment"># 确认更新提示框--这个函数的作用是确认提示框</span><br>Alert(driver).accept()<br><br><span class="hljs-comment"># 等待40秒更新</span><br>time.sleep(<span class="hljs-number">40</span>)<br><br><span class="hljs-comment"># 这个print其实没事什么用,如果真的要测试脚本是否运行成功，可以用try来抛出异常</span><br><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;success&quot;</span>)<br><br><span class="hljs-comment"># 脚本运行成功,退出浏览器</span><br>driver.quit()<br><br><span class="hljs-comment"># 写上更新日志</span><br><span class="hljs-comment"># 我这里是写在D盘</span><br>fp = <span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;D:\log.txt&quot;</span>, <span class="hljs-string">&quot;a+&quot;</span>)<br><span class="hljs-comment"># linux写在/home</span><br><span class="hljs-comment"># fp = open(&quot;/home/temp/log.log&quot;, &quot;a+&quot;)</span><br>now_time = time.strftime(<span class="hljs-string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>, time.localtime())<br>fp.write(<span class="hljs-string">&quot;auto update time:&#123;0&#125;\n&quot;</span>.<span class="hljs-built_in">format</span>(now_time))<br>fp.close()<br></code></pre></div></td></tr></table></figure>

<p>把源码黏贴到<code>gitee.py</code>文件内，备用。</p>
<h3 id="2-2-注意事项"><a href="#2-2-注意事项" class="headerlink" title="2.2 注意事项"></a>2.2 注意事项</h3><ul>
<li><p>html的id属性、xpath可以通过在chrome的网页里面按F12 -&gt; 选择一个元素进行检查(快捷键Ctrl + Shift + C)查看，如图就是<code>百度一下</code>的div块元素属性。<br><img src="https://closer_laps.coding.net/p/picture/d/picture/git/raw/master/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Python/CopyFullXPath.png" srcset="/img/loading.gif" lazyload alt="CopyXPath"></p>
</li>
<li><p>python selenium模块的具体函数使用方法请参考官方文档。  </p>
</li>
<li><p>编写自动签到脚本也差不多同样的道理。</p>
</li>
</ul>
<h2 id="三：-添加定时任务自动部署"><a href="#三：-添加定时任务自动部署" class="headerlink" title="三： 添加定时任务自动部署"></a>三： 添加定时任务自动部署</h2><h3 id="3-1-Windows主机"><a href="#3-1-Windows主机" class="headerlink" title="3.1 Windows主机"></a>3.1 Windows主机</h3><ol>
<li>登录windows云主机，复制<code>gitee.py</code>到D盘根目录。</li>
<li>云主机内-&gt;右键我的电脑-&gt;管理-&gt;工具-&gt;任务计划程序-&gt;创建基本任务…添加任务每天执行一次，实在不会的请<a target="_blank" rel="noopener" href="https://jingyan.baidu.com/article/154b463130041128ca8f41c7.html">百度</a></li>
<li>在自己电脑上的话也可以设置定时开关机，并把如下代码添加到<a target="_blank" rel="noopener" href="https://8hn9w5.coding-pages.com/2020/02/15/hexo/hexo%E4%B8%80%E9%94%AE%E4%B8%8A%E4%BC%A0%E9%83%A8%E7%BD%B2%E8%84%9A%E6%9C%AC%E7%9A%84%E6%9E%84%E5%BB%BA/">hexo一键上传部署脚本</a>的后面，每次定时git push后自动在gitee的pages界面部署。</li>
</ol>
<figure class="highlight bat"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs bat">@<span class="hljs-built_in">echo</span> off<br><span class="hljs-function"></span><br><span class="hljs-function">d:</span><br><span class="hljs-function"></span><br><span class="hljs-function"><span class="hljs-title">python</span> <span class="hljs-title">gitee.py</span></span><br><span class="hljs-function"><span class="hljs-title">echo</span> &quot;等待更新完成过后再关闭窗口&quot;</span><br><span class="hljs-function"><span class="hljs-title">timeout</span> /<span class="hljs-title">t</span> 180</span><br><span class="hljs-function"><span class="hljs-title">rem</span> 上面的代码是等待3分钟。</span><br></code></pre></div></td></tr></table></figure>

<h3 id="3-2-Linux主机"><a href="#3-2-Linux主机" class="headerlink" title="3.2 Linux主机"></a>3.2 Linux主机</h3><ol>
<li>登录Linux云主机，复制<code>gitee.py</code>到<code>/home/temp/</code>目录。</li>
<li>添加Linux计划任务<br><code>crontab -e</code></li>
<li>选择1选项nano编辑，光标拉到最后面，复制如下代码;</li>
<li><code>10 6 * * * /home/temp/gitee.py start</code></li>
</ol>
<p>说明：</p>
<ul>
<li><a target="_blank" rel="noopener" href="http://www.bejson.com/othertools/cron/">crontab表达式在线生成</a></li>
<li>延迟0~1小时的话，直接在py或者sh文件中利用sleep及random命令设置。</li>
<li><code>crontab -l</code>查看当前已经保存的计划任务。</li>
</ul>
<h2 id="四：-参考文献"><a href="#四：-参考文献" class="headerlink" title="四： 参考文献"></a>四： 参考文献</h2><ul>
<li><a target="_blank" rel="noopener" href="https://python-selenium-zh.readthedocs.io/zh_CN/latest/">https://python-selenium-zh.readthedocs.io/zh_CN/latest/</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/ydydyd00/article/details/80882183">https://blog.csdn.net/ydydyd00/article/details/80882183</a></li>
<li><a target="_blank" rel="noopener" href="https://jingyan.baidu.com/article/154b463130041128ca8f41c7.html">https://jingyan.baidu.com/article/154b463130041128ca8f41c7.html</a></li>
<li><a target="_blank" rel="noopener" href="https://jupitersh.gitee.io/2020/02/Preparation-for-Gitee-Auto-Update-by-Ptyhon/">https://jupitersh.gitee.io/2020/02/Preparation-for-Gitee-Auto-Update-by-Ptyhon/</a></li>
</ul>
<p><strong>enjoy!</strong></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/python/">python</a>
                    
                      <a class="hover-with-bg" href="/categories/python/hexo/">hexo</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/hexo/">hexo</a>
                    
                      <a class="hover-with-bg" href="/tags/python/">python</a>
                    
                      <a class="hover-with-bg" href="/tags/%E8%87%AA%E5%8A%A8%E7%AD%BE%E5%88%B0/">自动签到</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2020/02/17/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Linux/ubuntu%E5%AE%89%E8%A3%85%E5%AE%8C%E4%BB%A5%E5%90%8E%E7%9A%84%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">ubuntu安装完以后的基础配置</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2020/02/16/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Python/you-get%E4%B8%8B%E8%BD%BD%E8%A7%86%E9%A2%91/">
                        <span class="hidden-mobile">you-get下载视频</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js', function () {
        new Valine({
          el: "#valine",
          app_id: "YzLqNtMw1YEwwACli1FUsIUM-gzGzoHsz",
          app_key: "HLUt5izfTvTcbEbOrA59W92a",
          placeholder: "畅所欲言...",
          path: window.location.pathname,
          avatar: "robohash",
          meta: ["nick","mail","link"],
          pageSize: "10",
          lang: "zh-CN",
          highlight: true,
          recordIP: false,
          serverURLs: "",
        });
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->

  <div class="col-lg-7 mx-auto nopadding-x-md">
    <div class="container custom post-custom mx-auto">
      <img src="https://closer_laps.coding.net/p/picture/d/picture/git/raw/master/pay/pay.png" srcset="/img/loading.gif" lazyload class="rounded mx-auto d-block mt-3" style="width:355.4px; height:200px;">
    </div>
  </div>


    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- LeanCloud 统计PV -->
        <span id="leancloud-site-pv-container" style="display: none">
            总访问量 
            <span id="leancloud-site-pv"></span>
             次
          </span>
      
      
        <!-- LeanCloud 统计UV -->
        <span id="leancloud-site-uv-container" style="display: none">
            总访客数 
            <span id="leancloud-site-uv"></span>
             人
          </span>
      

    
  </div>


  
  <!-- 备案信息 -->
  <div class="beian">
    <span>
      <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
        苏ICP备20032307号
      </a>
    </span>
    
      
        <span>
          <a
            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=32020602001023"
            rel="nofollow noopener"
            class="beian-police"
            target="_blank"
          >
            
              <span style="visibility: hidden; width: 0">|</span>
              <img src="/img/police_beian.png" srcset="/img/loading.gif" lazyload alt="police-icon"/>
            
            <span>苏公网安备 32020602001023号</span>
          </a>
        </span>
      
    
  </div>


  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  <script  src="https://cdn.jsdelivr.net/npm/tocbot@4.12.2/dist/tocbot.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/anchor.min.js" ></script>



  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js" ></script>




  <script defer src="/js/leancloud.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>





  

  
    <!-- MathJax -->
    <script>
      MathJax = {
        tex: {
          inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        options: {
          renderActions: {
            findScript: [10, doc => {
              document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
                const display = !!node.type.match(/; *mode=display/);
                const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                const text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = { node: text, delim: '', n: 0 };
                math.end = { node: text, delim: '', n: 0 };
                doc.math.push(math);
              });
            }, '', false],
            insertedScript: [200, () => {
              document.querySelectorAll('mjx-container').forEach(node => {
                let target = node.parentNode;
                if (target.nodeName.toLowerCase() === 'li') {
                  target.parentNode.classList.add('has-jax');
                }
              });
            }, '', false]
          }
        }
      };
    </script>

    <script async src="https://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/tex-svg.js" ></script>

  








  
    <!-- Baidu Analytics -->
    <script defer>
      var _hmt = _hmt || [];
      (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?608f2baddd361128381ad2bf9377bf89";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  

  

  

  

  

  





<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
